Shows a value on the screen while you test your game, so you can see it change without writing any drawing code: debug_watch("hp", hp). Each label gets its own row in the top-right corner. It only works in a Development Build: in the finished game (a Release Build) it shows nothing and costs nothing.
Works differently on Game Boy - The Game Boy does not show watch values on the screen, so debug_watch does nothing there.
Works differently on Game Boy Color - The Game Boy Color does not show watch values on the screen, so debug_watch does nothing there.
On other consoles this differs: see Side by side and How the consoles differ.
debug_watch(label, value)| Name | Type |
|---|---|
label | string |
value | any |
Nothing.
Shows a value on the screen while you test your game, so you can watch it change without writing any drawing code. Each label gets its own row in the top-right corner.
It only works in a Development Build. In the finished game (a Release Build) it shows nothing, and the call costs nothing.
debug_watch("x", x);
debug_watch("speed", speed);
debug_watch("ready", every(60));The screen shows three rows, x, speed and ready, each with its newest value.
A whole number, a decimal, true or false, or text. Anything else, such as a list, is refused when the project is checked.
debug_watch draws nothing and uses no memory. The things you give it are still worked out and then thrown away.debug_watch has no trace of any of this.Unlike log_write, which writes to the emulator's log window, this one draws on the game's own screen, so it works on a real console too.
In a Development Build, one small text row for each label, redrawn only when it changes.
Up to six different labels at once; a seventh is not shown. The label is cut to 8 characters and the value to 8, and a row stays where its label first appeared. The value can be a whole number, a decimal, true or false, or text. Call it every frame in a Step event to follow a value as it changes; the row is only redrawn when the text changes, so a steady value costs almost nothing. While the debug overlay is open (the button chord from Project Settings) the rows hide so they do not write over it. In a release build - safety checks off, which --release does - the call is an empty function: nothing is drawn, no memory is used and the arguments are still worked out but then thrown away. A game that never calls debug_watch has no trace of any of this. Unlike log_write, which writes to the emulator's log window, this one is drawn on the game's own screen.